09. [IMPORTANT] Shutdown your Instance

[IMPORTANT] Shutdown your Instance

Remember to shutdown your instance when not-in-use.

From this point on, Google will charge you for a running an Compute Engine instance. GPU prices are listed on this page, and you can find details about CPU compute time on the Compute Engine pricing page.

Most importantly, remember to “stop” (i.e. shutdown) your instances when you are not using them. You can do it with the following command:

gcloud compute instances stop $INSTANCE_NAME

Or if you want to delete instance completely:

gcloud compute instances delete $INSTANCE_NAME

To delete or not to delete?

  • If you are temporarily stopping a project, and plan to return to it very soon (within the hour), it's recommended that you stop the instance.
  • If you are stopping for a long period of time (more than a few hours) and/or have completed a project and do not intend on returning, it's recommended that you delete the instance.

Shut it down gif from the show New Girl.

Shut it down gif from the show New Girl.

Pricing

  • Google charges primarily for running instances. There are smaller storage charges that continue to accrue until you “terminate” (i.e. delete) the instance.
  • As of this writing, the cost of a recommended VM plus a k80 GPU is approximately$0.60/hr $200 of credits will give you more than 300 hours of compute which should be more than enough time to complete your final project assuming you stop down the machine when you are not using it.
  • Pricing changes frequently and depends on region. Please see Compute Engine pricing for the latest information.
  • When you run out of credits on your account, your services will be stopped. In order to continue using Google Cloud Platform, please create a new Billing account and move your projects to it.

Updates and Troubleshooting

Common Problems

Problem: ImportError: No module named 'cv2'
Solution: Install Python wrapper for openCV:

sudo pip3 install opencv-python
sudo pip install opencv-python

Problem: JavaScript output is disabled in JupyterLab
Solution: In the notebook change %matplotlib notebook to %matplotlib inline and re-run the notebook.

Updating PyTorch Versions

We should periodically update the virtual machine image (which controls the available libraries in an environment) in these instructions to the latest PyTorch image. Here's a gcloud command to update the image:

gcloud compute images describe-from-family pytorch-latest-cu91 --project=deeplearning-platform-release --format "value(name)"